private static function packJsonError($code, $message, $id) {

        if ( !is_null($id) ) {

            return array(
                'jsonrpc' => '2.0',
                'error' => array(
                    'code' => $code,
                    'message' => $message
                ),
                'id' => $id
            );

        } else {

            return null;

        }

    }