Custom x-api-key change to localapikey strategy, misc code cleanup