refactoring python server by nodejs