fix collection controller, add tests