Added a base controller class to include some common helper functions.