Router Functionalities

Defines the main function of the router.