fixed nullPointer from last commit. Still need to implement some functions in authentication service.