Implemented nesting_level check for json_dump to avoid dumping outer references