Fixed the database conflict and circuit breaker

- The circuit breaker was recovering the wrong future
- The database conflicts are now dealt with
- Also fixed how the ref URL gets mapped back in