Added some pre and post hooks to controllers.