Create the embedded $resource object

Previously we were taking a pre-created $resource object from the user,
but we need access to the arguments that were created during its
invocation.