Refactored validation callback to be compliant with node callbacks and promise frameworks