begin use $resource for RestFull interaction