Added json handling for model.