Add union function to API.