Only loop through databases once

When mapping databases for API calls, only loop through the list once. 

Realized we were looping through the array 2x as of heroku/heroku#928 only after it was merged :panda_face: