added helper function to parse URL params and return mongo query