refactored async rest call