added phpdoc commenting, renamed some functions

the functions that have been renamed have been also changed in the
routes to match