Prepare data for API