public function jsonResponse($data)
    {
        $this->_headers[] = 'Content-Type: application/json';

        if (!headers_sent()) {
            foreach ($this->_headers as $header) {
                header($header, true);
            }
        }
        echo json_encode($data);
    }