Fix database saving bugs (now server saves to DB itself).