only import what's needed in Server
reindent Server
move constants to top of file
cleanup and document types
cleanup and document rest of Server