Update key.json file
Complete and refactor adding groups, fix tests