public function init()
    {
        // Autoload the models and components directory 
        $this->setImport(array(
            'api.models.*',
            'api.components.*',
        ));
        
        // Disable layout rendering
        $this->layout = false;
        
        // Disable logging for the API
        foreach(Yii::app()->log->routes as $k=>$v)
        {
            if (get_class($v) == 'CWebLogRoute' || get_class($v) == "CProfileLogRoute")
                Yii::app()->log->routes[$k]->enabled = false; 
        }
        
        // Set default components and routes
        Yii::app()->setComponents(array(
            'errorHandler' => array(
                'errorAction'  => 'api/default/error',
            ),
            'messages' => array(
                'class' => 'cii.components.CiiPHPMessageSource',
                'basePath' => Yii::getPathOfAlias('application.modules.api')
            )
        ));
    }