add logging to server
most of the client