laid out structure and tests for publish API
added middleware and tests for determining API options