api: add iter function for json arrays and objects