Added tests and refactored to use caching for authentication
Added end of turn resource. Need to test it.