support CORS in APIs
pep8
fix incorrect import
Merge pull request #4564 from dimagi/api-cors

Support CORS in APIs