Improve the test coverage of services, controllers

Added more tests for services and controllers

### Notes

* Add `::ffff:127.0.0.1` to `config/local.js`
But in reality, this shouldn't be called multiple times.