almost got the api call working