use $resource in service