add retries to REST API calls. fixes #2