Fix datetime issue causing 500 on requests that use start and end times.
Fix for requests where end date is before start date.