Used duck typing to determine whether or not 'r.json' is called

This was throwing an error with the latest version of the requests package and python 2.7