Surely we don't need to add the repository to the API here? We can still find it from the trees even if one is nil.