protected function _response($response) { if ($response && (is_array($response) || is_object($response))) { header('Content-type: application/json; charset=utf-8'); print CoreEvents::json_encode($response); } }