start of server side - not finished yet