invalid type (list) for variable '.response' *

It is hard to say what the problem is without more details. The best way is with a reproducible example as explained in this post

At the least, show us your actual code and the structure of your data. You can make neat code blocks by putting three back ticks, ```, on the lines just above and below the code. the back tic is just to the left of the 1 key on English keyboards.