Update code and add offline sync
Updates