}); /* GET DATA corresponding to a merchant */ $app->get('/merchant/:id/data', 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->getData($request); // echo json response echoRespnse(200, $response); }); /* GET USERS corresponding to a merchant */ $app->get('/merchant/:id/users', 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;