Add memorisation to resource queries