Added methods to synch local database with server. Need to be tested.