Added method to check if a given id is of a type