handle parameter prefix in buildQuery and appendQueryParameters

this means that outside of these functions we just look for 'e' or 'p'

additionally, only read parameters from the query that begin with the prefix