JSON header fix for the flat option and encapsulation capability