added timerange check for api