gets JSON from API.