updated front controllers dispatch function allong with creating a base controller