Since the development of Rooftop, the WordPress ecosystem for API-first sites has become much more mature. We suggest investigating the WP Rest API or WP-Graphql plugins.
rooftopcms/rooftop-cms
Rooftop CMS is an API-first WordPress CMS for developers and content creators
RubyGPL-3.0