More robust code :)
Added Access-Control-Allow-Origin header