Rewrite the json message parsing to work recursively