Added meaningful error responses.
Update client to accept error events.