Add guava caching and fix NPE