title: Changing Yii2 API actions
body: <p>I use yii2 (2.0.13). when i send data with ajax, the return response includes an error.    </p>
  
  <p>my code:    </p>
  
  <pre><code>namespace frontend\controllers;
  
  use Yii;
  use yii\rest\ActiveController;    
  
  class CityController extends ActiveController
  {
      public $modelClass = 'frontend\models\City';
  
      public function actions()
      {
          $actions = parent::actions();
           unset($actions['create']);
          return $actions;
      }    
  
      public function behaviors()
      {
          $behaviors = parent::behaviors();
  
          // remove authentication filter
          $auth = $behaviors['authenticator'];
          unset($behaviors['authenticator']);
  
         // add CORS filter
          $behaviors['corsFilter'] = [
              'class' =&gt; \yii\filters\Cors::className(),
          ];
  
          // re-add authentication filter
          $behaviors['authenticator'] = $auth;
          // avoid authentication on CORS-pre-flight requests (HTTP OPTIONS method)
          $behaviors['authenticator']['except'] = ['options'];
  
          return $behaviors;
      }    
  
      public function actionCreate()
      {
        echo 'Hi i\'m create!!';
      }
  }    
  </code></pre>
  
  <p>And ajax request:    </p>
  
  <pre><code>$.ajax({
              url: "http://blog.dev/city", // our php file
              type: 'POST',
              contentType: false,
              cache: false,
              processData: false,
              data: {x: 'data_text'},
              success: function(data){
                  console.log(data);
              },
              error: function (request) {
                  console.log(request);
              }
          });    
  </code></pre>
  
  <p>When in the actionCreate I add <strong><em>exit()</em></strong> the problem is fixed.<br>
  Where is the problem and exactly how should I change actionCreate?<br>
  Help me, please.</p>