format character JSON and store in database