Added json handling for model. Ongoing...