Changed handling of JSON decoding when expected response is an array