public function upvote() { if (isset($_POST["id"])) { $id = $_POST["id"]; $answerModel = new Answer(); $answerModel->upvote($id); $this->jsonResponse(["status" => "OK"]); } else { $this->jsonResponse(["error" => "Missing parameter ID"], 400); } }