Changed the routes and handlers to handle the calls of the primary and secondary.