Enhanced parseJSON
Added error handling for model

Fixed #49