Fixed error handling.
Added examples to client.