Changing angular  calls to resource in a service