added unit testing to json parsing method