Added offset and limit support to queries