init server code