adapt to mysql and statr to add json