$app->get('/merchant', function () use($app) { // check for required params $request = array(); $response = array(); $userName = array(); $password = array(); $headers = $app->request->headers->all(); // verifyHeaders(array('Key')); // reading request params $userName = $headers['Username']; $password = $headers['Password']; $request['userName'] = $userName; $request['password'] = $password; $controller = new ApiController(); // Call controller function $response = $controller->login($request); // echo json response echoRespnse(200, $response); }); /* GET PRODUCTS, CATEGORY, SUBCATEGORY INFORMATION ABOUT SPECIFIC RESTAURANT * 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'];