fix get_table_of_contents script, and generate new object for API