allow retrieval of a resource by an alias
fix indentation
merged changes from upstream