update requests.py to trap JSON error