Adding sync code and base tests