Define functions to search objects by id