renaming deserialize to toJson