fixed a missing JSON.parse if the server responds with non-json