moved api calls to background