separating out apidocs functionality into its own class; improving error functionality to send or output text so apidocs can make use of error reporting (may move this to its own class eventually