Fix sync API (this branch still broken for other reasons)