using inbuilt service $resource with promise library
using cacheFactory service