How about serving custom headers

I've added some functionality to error method in API.php and output, response in response.php
This might look ugly but the Idea is to have certain headers to be served when wrong syntax used in queries or authentication has failed. 

Currently there's only 200 which is pretty annoying when working with backbone.js

Please feel free to criticize my code I am new to PHP and will fix it accordingly.