public function sendResponse(\Nette\Application\IResponse $response)
{
if ($response instanceof \Nette\Application\Responses\JsonResponse) {
$response->send($this->getHttpRequest(), $this->getHttpResponse());
} else {
parent::sendResponse($response);
}
}