Ton of code. Full implementation of model sync. DB and server.