title: CakePHP 4 : Simple JSON view return
body: <p>I am new in cakephp, 
  I am trying to develop a simple REST BREAD (BROWSE, READ, EDIT, ADD, DELETE) using cakephp version 4.
  After installed I created a simple controller called UsersController with method <code>index,view,edit,delete</code>. Not created any model and templates yet. </p>
  
  <p>For Browse json, in Users/index method I have used code like </p>
  
  <pre><code>public function index()
  {
            $users = $this-&gt;Users-&gt;find('all');
            echo json_encode($users);
            exit;
  } 
  </code></pre>
  
  <p>Output : </p>
  
  <pre><code>[
    {
      "id": 1,
      "username": "jone",
      "created": "2020-01-22T00:00:00+00:00",
      "modified": "2020-01-22T00:00:00+00:00"
    }
  ]
  </code></pre>
  
  <p>Questions : </p>
  
  <p>1) Without using exit how I will prevent controller to render <code>not found template error exception</code> ? </p>
  
  <p>2) How I will change http response code using cake asset. example <code>200 ok will be 2000 ok.</code> ? </p>
  
  <p>3) Without use json_encode , am I able to return a json view using cakephp asset, if yes then how ? </p>