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