Refactor: use error handler
Refactor: add average rate in user and product collection