added CORS middleware to handle preflight (options) requests and cross origin resource sharing
see also: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS