parse json into a State