Added Logic to convert Java Tree Object to JSON tree.