updated parser for validating json