refactored error messaging to model from controller
refactored error messaging to model from controller