[IMP] improved sync service with flag check for updating and removing data from server and local, added state for selecting functional value when syncing data