Better error handling for json requests. Fixed language issue