first pass server code