loadResource returns a promise