Modify the serialize method to assume JSON-formatted value.