I tried to install RESTful API module from this <http://budiirawan.com/setup-restful-api-yii2/> and I am getting error

> 
> Object not found!
> 
> 
> 

I tried setting `mod_rewrite` and also `AllowOverride All` configuration.

I also have connected it to correct database and that database has `country` table in it.

I also have `.htaccess` file and here is my `api/config/main.php` file

```
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);

return [
'id' => 'app-api',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'modules' => [
    'v1' => [
        'basePath' => '@app/modules/v1',
        'class' => 'api\modules\v1\Module'  
    ]
],
'components' => [
    'user' => [
        'identityClass' => 'common\models\User',
        'enableAutoLogin' => false,
    ],
    'log' => [
        'traceLevel' => YII_DEBUG ? 3 : 0,
        'targets' => [
            [
                'class' => 'yii\log\FileTarget',
                'levels' => ['error', 'warning'],
            ],
        ],
    ],
    'urlManager' => [
        'enablePrettyUrl' => true,
        'enableStrictParsing' => true,
        'showScriptName' => false,
        'rules' => [
            [
                'class' => 'yii\rest\UrlRule',
                'controller' => 'v1/country',  
                'tokens' => [
                    '{id}' => '<id:\\w+>'
                ]
            ]
        ],
    ]
],
'params' => $params,
];    

```

Here is the model `Country`

```
<?php

namespace api\modules\v1\models;

use yii\db\ActiveRecord;
/**
 * Country Model
 *
 * @author Budi Irawan <deerawan@gmail.com>
 */
class Country extends ActiveRecord
{
/**
 * @inheritdoc
 */
public static function tableName()
{
    return 'country';
}

/**
 * We use the primary function because we don't use integer auto increment as a primary key.
 * @inheritdoc
 */
public static function primaryKey()
{
    return ['code'];
}

/**
 * To let Yii know what fields exist on the table.
 * Define rules for validation
 */
public function rules()
{
    return [
        [['code', 'name', 'population'], 'required']
    ];
 }
}

```

I still get the same error while accessing it through <http://localhost/yii2-api/api/v1/countries>.