allow setting g.api_key through local_request