Fixed bug in the histogram endpoint