refactored json feed + caching into a function