cleaned up the code and comments a bit and verified that the backendservice.py main routine worked for Mengyuan to use in testing