resource: improve ResourceBuilder->Resource param passing.
resource: all resources to have metadata.
resource: make ResourceBuilder generic.