Fixed autoloading issue and updated the router functionality