server code, version 1