This should be in an API.