} else { if ($ROUTE[$_POST['function']]['url'] === 'addProduct') { $cont = new controllers(); $cont->addProduct($_POST, $token); } else { if ($ROUTE[$_POST['function']]['url'] === 'searchProduct') { $cont = new controllers(); $cont->searchProduct($_POST, $token); } else { if ($ROUTE[$_POST['function']]['url'] === 'registration') { $cont = new controllers(); $cont->registration($_POST); } else { if ($ROUTE[$_POST['function']]['url'] === 'login') { $cont = new controllers(); $cont->login($_POST); } else { if ($ROUTE[$_POST['function']]['url'] === 'logout') { $cont = new controllers(); $cont->logout($token); } else { if ($ROUTE[$_POST['function']]['url'] === 'viewAll') { $cont = new controllers(); $cont->viewAll($token); } else { if ($ROUTE[$_POST['function']]['url'] === 'updateProduct') { $cont = new controllers(); $cont->updateProduct($_POST, $token); } else { $ret['message'] = "No such function"; $ret['status_code'] = 404;