somewhat related post: Check if virtual page exists since it shows code of how to query an api and store that in a cache