Fixed code errors + basic tets for clients controller