Detect changes in API
Fix up race condition in tests