Making the API return the correct status code when a group already exists

I was working with the API and noticed that I received a "not found" error when a group already existed. I made this change to make it return the correct status code for when a group name or a group path already exists.