create generalized load_resource_by_key