introduced json encoder for creation and updates