Adding code for JSON serialization