Third commit of total server-side rework. not done.