This is a simple service used only for prototyping that will allow us
to simply change and recreate database schemas. Eventually, we'll need
to replace it with database migration logic.
[MAILPOET-4135]
This means the exception need to have string error code, HTTP status code, and a message,
as the WP REST API errors look as foolows:
{"code":"rest_invalid_json","message":"Invalid JSON body passed.","data":{"status":400,"json_error_code":4,"json_error_message":"Syntax error"}}
[MAILPOET-4135]
Each endpoint will be a class that can implement get/post/put/delete methods.
The routes are registered to WP REST API automatically based on the existence
of implemented methods. The endpoint classes are handled standard services and
therefore can leverage full powers of the DI container.
[MAILPOET-4135]