added raw and json parsing logic and tests