Make subresource creation recursive, fix reference keys so that it is key => (keyReference => (uri => reference/uri))