js code improvements
handle empty result, new UI