new bin parameter for histograms and a flat array for the data api