add caching and db logging