make database host configurable
more work
Hotfix: update the view if RestClient responds with a status of 500
Added `sum` function so reduce function that use it work correctly.