public function error($message, $return = false)
    {
        $json = $this->jsonEncode(
            array(
                'error' => true,
                'message' => $message,
            )
        );
        if (!$return) {
            echo $json;
            Yii::app()->end();
        } else {
            return $json;
        }
    }