protected function renderHttpAsJsonApi(HttpException $error) {
		// Add a response type for JSON API
		$this->controller->response->type(array('jsonapi' => 'application/vnd.api+json'));
		// Set the controller to response as JSON API
		$this->controller->response->type('jsonapi');
		// Set the correct Status Code
		$this->controller->response->statusCode($error->getCode());

		// set the errors object to match JsonApi's standard
		$errors = array(
			'errors' => array(
				'id' => null,
				'href' => null,
				'status' => h($error->getCode()),
				'code' => h(get_class($error)),
				'title' => h($error->getMessage()),
				'detail' => h($error->getMessage()),
				'links' => array(),
				'paths' => array(),
			),
		);
		// json encode the errors
		$jsonEncodedErrors = json_encode($errors);

		// set the body to the json encoded errors
		$this->controller->response->body($jsonEncodedErrors);
		return $this->controller->response->send();
	}