Fixed uniquess and added index to username and added tests