Fix for earlier fix - Ensuring data is encoded correctly for the API.