public function output(string $mime)
    {
        $pprint = $this->pretty_printing;
        $classname = $this->file_formats[$mime] ?? "NullWriter";
        
        $output = "";
        try 
        {
            if ($classname instanceof AbstractWriter)
                $writer = $classname;
            elseif (class_exists($classname))
                $writer = new $classname($pprint);
            else
                throw new InvalidArgumentException("Response writer $classname does not exist");

            $writer->setPrettyPrint($pprint);
            $op = fopen("php://output", "w");
            $writer->write($this->data, $op);
            fclose($op);
        }
        catch (Throwable $e)
        {
            // Bad. Attempt to override response type if still possible
            self::getLogger()->critical('Could not output data, exception occured while writing: {0}', [$e]);
            echo WF::str($this->data->getAll());
        }
    }