Added CORS support for REST requests

allow clients on different domains to make rest requests to the server