added controller method tests and fixed some bugs