cleanup the python api client with the right signal handlers