Add function: insert_riap_stuffs_to_res