Rework code some more so that clients are able to send to server