added custom CORS header field, fixed #4
added logger
added some error logging