update api, control, and listener files. Implement callback functions