finally syncing correctly, saving to database, improved model serialization