Adding get groups func in models