Update retrieve_data to use id's instead of names