Changed exception handling.
The following exceptions are caught:
* JSONException
* IllegalArgumentException