Feature/add cors support

This PR adds support for CORS headers and attempts to fix #3