(PE-1673) Properly handle malformed order-by input

Prior to this commit, an invalid JSON input for the
'order-by' query paging parameter was causing an
exception to be thrown and an incorrect response to
be returned. This commit adds proper error handling.