add tests and fix basic auth usage