make code work directly on json output by the API.