python 2 to 3 in api.py 's json.loads