public function output($isFinal = false)
    {
        // Check if final output is true
        if ($this->finalOutput) {
            return;
        }
        $this->finalOutput = $isFinal;

        // HTTP status header
        header("HTTP/1.1 {$this->statusCode} {$this->getStatusMessage($this->statusCode)}");

        // Disable caching
        header("Cache-Control: no-cache, must-revalidate");
        header("Expires: 0");

        // Add the current uri to the hypertext routes
        $this->hypertextRoutes['self'] = $this->uri;

        // Create the response object, output the headers and print the response
        $response = (new \RestPHP\Response\ResponseFactory())->build(
            $this->responseType,
            $this->response,
            $this->hypertextRoutes
        );
        $response->outputHeaders();
        echo $response;

        // Return the current object
        return $this;
    }