fix if user not authorized
add cache tests
.
merge