Reworking my website - API

The plan for the API is to have it on the PHP admin panel side (mainly because that's the easiest and most straight forward for me). The implementation for the API is based on my API for steamdeckdb.net which is heavily influenced by the IGDB api.

To make the API modular so I can use it in other projects, I've decided to add a subdirectory for it ("/api") and implement my prebuilt classes for database connection and API.

The first dilemma that I've thought about is whether I need to require authentication to pull data or not. What is the chance/risk that someone will try and pull a bunch of data with my API endpoints? I reckon it's pretty low. For now, I will not implement an authentication system, but ill have to reevaluate at a later date.

To be able to keep track of the status of an API call I have added my context class with a new "status" class. The context class helps me save and reuse information and the status class will hold the HTTP code and potential error messages.

The current plan for what endpoints I need is:
/portfolio/get
/socials/get
/blog/get
/blogcategories/get

For each endpoint, I will have a way to sort, filter, and limit the result right away. This will be done similarly to how the IGDB works.

Let's start with the portfolio...

Is it possible to make a general structure to the API so that you just input a "table" and an action and it knows where to grab it? Is that the best way of doing it? The API endpoint "dimension" (the first part of the URL) would need to be the same as the table so that I can just reuse it. Preferably I would like to be able to reuse the API without doing any changes. I'm thinking that I can either make one definition for dimensions and one for actions OR I can make just one definition that has a key-value pair between dimensions and actions. I think that the best solution is a key-value pair since I also need to specify accepted columns (since this could be a security issue).

For now, the structure looks like this, which seems to work:

The API is pretty ready. I can pull all the things I need (I think) so I think I'm ready to start making the new site!