building string outside of api call