fix Python3 TypeError when parsing response content

Now passing resp.text instead of resp.content to json.loads() to avoid Python3 TypeError. Previously, this part of the code would fail in Python3 because resp.content is of type binary, not str.