update deserialize to handle both array(primitive) and Array(model)