add 502 error and minor fixes to examples