function validator (schema, payload) {
	return new Promise(function (resolve, reject) {
		if (!payload) {
			reject(new error.InternalValidationError('Payload is falsy'));
		} else {
			try {
				let validate = ajv.compile(schema);
				let valid    = validate(payload);

				if (valid && !validate.errors) {
					resolve(_.cloneDeep(payload));
				} else {
					let message = ajv.errorsText(validate.errors);
					reject(new error.InternalValidationError(message));
				}
			} catch (err) {
				reject(err);
			}
		}
	});
}
@param   {Object} schema
@param   {Object} payload
@returns {Promise}