changes according to sylvains suggestions, webapp param is --enable-cors and better control flow using respond_to on ports