finishing server logic