Better response and error handling in example4