Query scirpt endpoint, fix lot of datetime issues