first working draft of json parsing