Fixed facility methods in controller and added tests for them