I am returning response from onBootStrap() this way..
$app = $e->getApplication();
$em->attach(MvcEvent::EVENT_ROUTE, function($e) use ($app) {
$response = $e->getResponse();
$response->setStatusCode(403);
$jsonValue = json_encode(array(
'error' => 12345,
'message' => 'You are not authorized for this request',
));
$response->setContent($jsonValue);
return $response;
}, PHP_INT_MAX);
But the problem is I am getting status code 200 even if I am passing different ones.
I am running this API from Advanced rest API client.