Change from using json.loads to using built-in Response.json method