since we use arrays, we need to encode json