* RESPONSE AND VALIDATION CODE SHOULD BE MADE */ $app->get('/merchant/:id/products', function ($id) use($app) { // check for required params $request = array(); $response = array(); $apiKey = array(); $headers = $app->request->headers->all(); verifyHeaders(array('Key')); // reading request params $apiKey = $headers['Key']; $request['apiKey'] = $apiKey; $request['restaurantID'] = $id; $controller = new ApiController(); // Call controller function $response = $controller->getProd($request); // echo json response echoRespnse(200, $response); }); /* GET RESTAURANT * REINFORCE VALIDATIONS IN CASE OF WRONG DETAILS */ $app->get('/merchant/:id/detail', function ($id) use($app) { // check for required params $request = array(); $response = array(); $apiKey = array(); $headers = $app->request->headers->all(); verifyHeaders(array('Key')); // reading request params $apiKey = $headers['Key'];