added model and json parsing code