Use api.hostname from main api function