Implement circuit breaker pattern for API calls. Should support configurable failure thresholds, recovery timeouts, and half-open states.