format data when supplying a JSON object