changes for finishing server rewrite