private function dossiers() { if ($this->get_request_method() != "GET") { $this->response('', 406); } $dossier = new Dossier(); $result = $dossier->dossiers(); $this->response($this->json($result), 200); // send user details $this->response('', 204); // If no records "No Content" status }