Using db api caching mechanism instead of util_memoize.