First draft of server part