refactored API

 * Moved the api to be served from an http servlet

 * Added the web.xml and configured it to send all /api/* urls through
   the servlet.
Got the search criteria working.

 * Need to add the way of getting different types of inputs to work.