Major revamping of the server logic