fixed upload api bugs.