try/catch around JSON.parse

I've had occasional issues recently where the webpurify service would return HTML documents (server errors) in response to API requests. In those cases, JSON.parse would throw an exception and crash my application. I've added a try/catch around JSON.parse and tried to conform to the existing code (e.g. calling back with a string as an error).