complete basic server logic