Add new API endpoints

First, back up and say what problem you are trying to solve. It may be that you don’t need a new endpoint. Have you looked at the 'reverse engineering" topic?

Next search for “plugin howto”