public function dispatch(ResponseInterface $response, int $status, $result)
    {
        // Build output array
        $contents = [
            'status' => $status,
            'result' => $result,
        ];

        // Convert output to JSON
        $contents = json_encode($contents, JSON_PRETTY_PRINT);

        // Write Response to Body
        $response->getBody()->write($contents);

        // PSR-7 response
        return $response->withStatus($status); 
    }