You can put it where ever you want to put it. I keep it at the root level in my instance, but putting it in the /api folder makes sense.
You can write any code that you want. That being said you would have to write a Close and Update API to achieve those functions. The base API does not handle them currently.
There are also several Pull Request (PR) over at git hub that expands the existing API. If you search for API in PRs then you will find them. HEre are a couple to get you started if you want to use unofficial code.
https://github.com/osTicket/osTicket/pull/5019
https://github.com/osTicket/osTicket/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+API