Initial draft of server logic.