Methods to call APIs and loop through the returned JSON