better error handling for json forms