I am using Yii2 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
{"name":"Not Found","message":"","code":0,"status":404}
but in header status is 200 I need same status in header as in api response that is 404 if record not found. How I can change the header status according to api response