changes to API: added retry when uploading and downloading