added set_opt to the api