title: Having error with the cakephp controller for returning json response
body: <p>I have prepared a controller as below.</p>
  
  <pre><code>class TasksController extends AppController
  {    
      public function index()
      {
          $this-&gt;paginate = [
              'contain' =&gt; ['Users'],
              'conditions' =&gt; [
                  'Tasks.user_id' =&gt; $this-&gt;Auth-&gt;user('id'),
              ]
          ];
          $tasks = $this-&gt;paginate($this-&gt;Tasks);
          $this-&gt;set(compact('tasks'));
  
          //$this-&gt;set('tasks', $this-&gt;paginate($this-&gt;Tasks));
          $this-&gt;set('_serialize', ['tasks']);
      }
  }
  </code></pre>
  
  <p>and my AppController as below.</p>
  
  <pre><code>class AppController extends Controller
  {
      public function initialize()
      {
          parent::initialize();
  
          $this-&gt;loadComponent('RequestHandler');
          $this-&gt;loadComponent('Flash');
          $this-&gt;loadComponent("Auth", [
              'authorize' =&gt; 'Controller',
              'authenticate' =&gt; [
                  'Form' =&gt; [
                      'fields' =&gt; [
                          'username' =&gt; 'email',
                          'password' =&gt; 'password'
                      ]
                  ]
              ],
              'loginAction' =&gt; [
                  'controller' =&gt; 'Users',
                  'action' =&gt; 'login'
              ],
              'unauthorizedRedirect' =&gt; $this-&gt;referer()
          ]);
  
          $this-&gt;Auth-&gt;allow(['display']);
      }
  }
  </code></pre>
  
  <p>When I enter the following URL, "<a href="http://localhost/cake/tasks.json" rel="nofollow">http://localhost/cake/tasks.json</a>" I get the following error.</p>
  
  <pre><code>Error: Tasks.jsonController could not be found.
  
  Error: Create the class Tasks.jsonController below in file: src/Controller/Tasks.jsonController.php
  
  
  &lt;?php
  namespace App\Controller;
  
  use App\Controller\AppController;
  
  class Tasks.jsonController extends AppController
  {
  
  }
  </code></pre>
  
  <p>What is the problem here and how do I fix it without adding route or json view file.
  [I am using the CakePHP 3.0]</p>