Major refactoring: updated nodejs code and added python code