added document api stuff for activity state