Add support for syncing folders with server. Need some cleanup.