Cleanup and Consolidate Server.r

Cleanup and consolidate server.r functions.