fixing uncaught exception when response isn't json parsable