Add token creation for API
Procedure style refactoring
PHPdoc for methods
PHPdoc for methods
PHPdoc for methods