Format location data for API