Added support for error messages from server
minor updates in example code
Added support for error messages from server