I think the problem lies in this line:
for key,value in item.items:
dict.items()
is a method, so item.items
will give you the actual method (you then try to iterate over this method, hence the error). Instead, you want to call that method and get the result, so you'll need parentheses:
for key,value in item.items():