title: How to change status code in http header in yii2 RESTful api
body: <p>I am using <code>Yii2</code> for restful api and its working fine. However I want to change status in header. Suppose I want to access users ID 13 record and this id not found in database so my api response will be</p>
  
  <pre><code>{"name":"Not Found","message":"","code":0,"status":404}
  </code></pre>
  
  <p>but in <code>header status</code> is <code>200</code> I need same status in header as in api response that is <code>404</code> if record not found. How I can change the header status according to api response </p>