protected function buildResponse(APIResponse $APIResponse, ResponseInterface $response): ResponseInterface
    {
        $response = $response->withStatus(200, "200 OK");
        $response = $response->withAddedHeader("Content-Type", $APIResponse->getMIMEType());
        $response = $response->withAddedHeader("Content-Length", $APIResponse->getAsDataStream()->getSize());
        $this->logger->debug("Responding to request successfully");
        return $response->withBody($APIResponse->getAsDataStream());
    }