Check if a generated id is valid for the todo list