JSON API: Catch wrong container types

Avoids an assert/abort in rapidjson.