Add example server & refactoring client code.