limit number of attendees for event

limit number of attendees for event

Hello, 

I am developing an event registration system and would like to be able to set up a limit on how many people can register for an event. I was thinking about creating a field in "Events" to set the maximum number of users, and then I wanted to get the number of already registered users, however I don't see which API method I can use to do that. 

Thanks in advance.