Move error handling into a module
Add base controller