Fixed/enabled Cancel button

Also updated validation API error handling function so that it works
with any view.