refactor progress: write service with an API

The service contained a mix of function and unnamed function. This commit rewrite all of
them into function with an API returned at the end of the service.
chore dist: update