implemented most of local -> cloud sync