Added an JSON error instead of an HTML for API
Merge branch 'master' into android