some server code added, an example scheme
server code added