clean up code; attach the listeners to the API checkboxes and Update buttons smarter.