Addition of CORS flag and middleware.

Add response headers for CORS.