Changed resource object to return promise instead of values