added type information to create_cache and query_cache functions