added query views in db and thunked version of byApikey view query