Data validation at front and back