Added caching to queries.
Added caching to queries.