fix json header unset in write_json when chunk is str
add assert judgement in build_instance and validate method of StructuredDict