migrate server scripts to python 3