added tests for measures controller and cleaned up unused code