add apigen doc, minor changes in code for phpcs approval