update entities api to implement Iterable