add controller tests, refactor homeCtrl