yes, you can insert a lot of debugging messages, like:
Code:
x = json.loads(JSON)
print(x)
print(x["data"])
print(x["data"][0])
for a in x["data"][0]:
print(a)
print(a["leaders"])
print(a["leaders"][0])
for b in a["leaders"][0]:
print(b)
print (b["type"])
and you will see which part is wrong and what should be modified.
"string indices must be integers" means you use strings as indices instead of integers.
As it was mentioned you can use try/except to catch errors (if you wish). And please post the exact error message, the real code and real json example (you can remove/replace sensitive info obviously)