Validation helper with tests

Validation helper that returns a series of error messages if validation fails. To be used for the API.