retrieves list of names by ids