created validations for incoming data 

to make sure it is in the right form and the values are valid for sorting

data must be an array and the values must be ALL numbers OR ALL strings.