Added write interface for JSON and Binary