Add functional tests to all controllers. Fix #9.