### What problem does this PR solve? API refactor: stats_api and plugin_api ### Type of change - [x] Refactoring