Better error handling -- gets the label as well as the input
Better JSON error handling