Added a client, and made the server more robust