Finished controller and update test cases