At the beginning everything works well. This function is called when a time range is selected (LAST_SEVEN_DAYS, LAST_THIRTY_DAYS, etc... ). The function calls the back end a