demo server code