added JSON error handling for nasty providers