Yii2 Advanced Application Template with RESTful API configured. Take a look at http://budiirawan.com/setup-restful-api-yii2/ for more detail explanation
You need Composer installed first.
composer self-update
composer install
Open terminal and go to the project folder and run
Mac/Linux
php ./init
Windows
init
Choose development environment and finish the steps.
create your database and configure it in common/config/main-local.php
This command will create new country table and populate its data
./yii migrate
Make sure you already enable this mod. Follow this Tutorial