BUG: Fix redundant run of unwinding nested dictionary
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

The original implementation of checking whether the json contains nested structure is wrong as it will return `True` even for a non nested json (e.g. `[{'x' : 1}]`). The changes ensures that `nested_to_record` is not called unnecessarily