Fixed client to handle server failures.
Improved exception handling in the client.