[issue #176] [WIP] shifts accessing the database from the view to the controller and adds documentation