check the type of response.body to see if it is json or a string