process($request); echo json_encode(array('gadgets' => $response)); } else { throw new \Exception("No post data set"); } } catch (\Exception $e) { header("HTTP/1.0 500 Internal Server Error", true, 500); echo "

Internal Server Error


"; if (Config::get('debug')) { echo $e->getMessage() . "
";
        print_r(debug_backtrace());
        echo "
"; } echo ""; } } public function doGet() { header("HTTP/1.0 400 Bad Request", true, 400); echo ""; echo "

Error

"; echo ""; } }