deprecate State.name in rest api. Fix javadocs.