in this case i think it would be better if you send 0 or something and then check for that in your code.. i dont think you can ommit it like you have done - you can ommit the last one dir? i am positive but not any of the previous ones..
i am not sure what dir? is but sortfield looks like a FILTER to sort by something.. usually people use ? GET params to do that ie ?filter=name... etc