Add the error code into the JSON response

Add the HTTP response code into the JSON error response
Merge pull request #666 from jplock/jp-json-error-codes

Add the error code into the JSON response