Make caching API asynchronous

Closes #5