Fix for handling json object or array as input

In the docs there is an example with a single json object as data source.
The transform.prepareJson method expects the json data to be an array.
This PR is a fix for handling both arrays and single json objects as data source.
I also changed the docs to show the two scenarios.