app refactoring & apidoc