function listQuestions() { $getdata = new getData(); $questionlist = $getdata->get_questions(); header('Content-Type:application/json'); echo json_encode($questionlist); }