added log requests flag and fixed cors bug