Implement addRoute function