public function categories() { if (apiler::is_authorized()) { $view = new View('api/categories'); $cat = new Category_Model(); $view->categories = $cat->get_all(); $view->render(true); } else { apiler::not_authorized(); } }