working on server logic