This is needed to allow javascript requests.
see CORS
implement requests check as described in http://www.w3.org/TR/cors/