protected function process($input)
    {
        if ($this->responseType !== "json") {
            return $input;
        }

        // Unpack JSON Data
        $result = json_decode($input, true);

        // Catch decoding errors -- turn a bad JSON input into an empty result set
        // containing an appropriate error code.
        if (!$result) {
            $result = array(
                'recordCount' => 0,
                'documents' => array(),
                'errors' => array(
                    array(
                        'code' => 'PHP-Internal',
                        'message' => 'Cannot decode JSON response: ' . $input
                    )
                )
            );
        }

        // Detect errors
        if (isset($result['errors']) && is_array($result['errors'])) {
            foreach ($result['errors'] as $current) {
                $errors[] = "{$current['code']}: {$current['message']}";
            }
            $msg = 'Unable to process query<br />Summon returned: ' .
                implode('<br />', $errors);
            throw new SerialsSolutions_Summon_Exception($msg);
        }

        return $result;
    }