built get dates API. Same origin issue again