changed functionality of json parser

extra functionality and small code refactoring