protected function dump(array $data, $code = 200)
    {
        $this->output->status($code);

        switch ($this->_format) {
            case 'xml':
                $this->output->xml($data, $this->_xml_option);
                break;
            case 'jsonp':
                $this->output->jsonp($data, $this->_jsonp_callback);
                break;
            default:
                $this->output->json($data);

        }
        $this->output->end();
    }