add json method to model