Added support for basic auth and configurable data dir