tried to define most test cases in controller tests. still a lot of work to do.