updated getDates function for requests