finished server logic for one server