Invalid sort syntax returns 400.

It was previously returning a 500. Addresses #387.