Added MaxRetries for API call.