How to write an Webservice API Wrapper the drupal 7 way
The standard solution is to use the Services module, which provides hooks for you to define your own endpoints.

There's also Restful Web Services which has similar functionality but is geared more towards entity API integration.

If you literally want to write your own API from scratch then just use your best judgement - there aren't any Drupal-specific standards for that.