Add phpdoc, headers

Fix status => state to be more consistent