updated auth wrapper and added some unit tests