Custom rest api endpoint response json problem

Turn out it is caused by a BOM character from one of my included file. If you are having same problem, you can save your file to Encode in UTF8 without BOM.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)