[dcn] add origin to api request and fix the test and check with flake8