improve controller and add routes