smart downloading of database, adding synced_with column