adding basic auth. adding optional debug and profiling support.