Added failure logic ot the server, next to do is to have the client deal with timeouts