using resource and promises | frontend