Handle cross origin and options