Reformatted the JSON response to contain error messages and a clear handle on the http code