cache function

Cache files read in by the API