Move flight search logic from controller to model