server refactoring

interface, structure modification. protocol add on