Fixed bug in downloadata API