Introduce queryResource for bearer tokens logic