added in basic auth support for the resources, hooked into the db