added function to make it easier to test
fixed style bug
added controller spec for cancel operation
added path for cancel operation