Added caching of queries, fixed display of results