integration test fix and bug fix for api key update.