Changing this back to $resource usage