Refactored isUsernameAvailable to use blocks instead of notifications