fix get api key bug

if a stage is not in db, the api key will bi nil.
Auto-merging config/deploy.rb