add a callback on ajax call so that requests can be cached