Idempotency In APIs: Planning for Uncertainty