Implement callback for jsdialog and clean client_handler.cpp