communicating with API