get api hostname from config, other minor changes from feedback