Added condition to api command upload_bytes