refactored serialToJSON to nodeSerialToJSON