refactor: Use $resource promise instead of callback function