Updating startkey/endkey on query object.

Fixes #322