Simplified JSON result generation; handle no result and end-iteration in web-ui