Yii2 Rest Structure

I have a question regarding Yii2 with REST module.

I must separate into a different folder within the controls? eg




controllers 

- api -> apiRest

  - PersonController.php 

  - ItemController.php 


- PersonController.php -> web Access



How this structure used by the framework works?