updated middleware controller to be a martini handler