Adding validation to rest call.