add server code and common code