public function handleRequest(ServerRequestInterface $serverRequest, ResponseInterface $response): ResponseInterface
    {
        $response = $response->withProtocolVersion($serverRequest->getProtocolVersion());

        try {
            try {
                $APIRequest = $this->requestFactory->create($serverRequest);
            } catch (UnableToCreateRequestException $exception) {
                return $this->handleRequestFactoryException($exception, $response);
            }

            try {
                $APIResponse = $this->server->handleRequest($APIRequest);
            } catch (UnableToHandleRequestException $exception) {
                return $this->handleServerException($exception, $response);
            }

            return $this->buildResponse($APIResponse, $response);
        } catch (\Throwable $e) {
            $this->logCaughtThrowableResultingInHTTPCode(500, $e, LogLevel::CRITICAL);
            return $response->withStatus(500, "Internal Server Error");
        }
    }