Which API are you using?
I suggest you take a look at this tool, it's something you can model your software.