adding some exception handling to python server impl