The part on the buildQuery method that cleans the querystring from parameters that doesn't belong to the model has been moved to the first position of the middleware. This is to permit modification of the querystring in the middleware functions in case of user scope restrictions or other.
Fixed a problem when making multiple calls to the api. The module was saving on the queryOptions.current the last call options, but the expected behavior is that the queryOptions.current has to be initialized to a new object every new call.
Fixed cleanQuery error. cleanQuery call moved after middleware initialization to allow usage of populate and other options even when we are not using middleware.
Merge pull request #3 from nothingbuttumbleweed/master

cleanQuery method before the middleware is called