first iteration of back-end for time queries
merge