Refactor out the API response types.