added bin paramater to histogram and modified the emr_data_all api to return a flat array