Closes #6, adds hooks for controller actions