Adresses #191 - Added global error handler, url has to be fixed after setting CORS headers.