public function run(bool $return_response = false)
    {
        try {

            $dispatchResult = $this->dispatch();
            if ($dispatchResult instanceof ResponseInterface) { // 404 Not Found or 405 Not Allowed

                $response = $dispatchResult;

            } else {

                $requestHandler = new RequestHandler($this->container);
                $response = $requestHandler->handle($this->container->get("request"));

            }

            if ($return_response === false) {

                ResponseFactory::sendToClient($response);
                die();

            } else {

                return $response;

            }

        } catch (Exception $e) {

            $this->container->get("core-logger")->error($e->getMessage());
            throw $e;

        }
    }