Small change in add_fields to handle valid JSON objects

Changed add_field to correctly handle JSON objects that were not formatted with a line break after each key-value line and to make sure that the new fields added where stored as "FieldName" instead of just FieldName.