<feature/sync-engine> write unit tests fix bugs #138