Great question, when building an API you should always consider your audience. An API is meant to communicate what can be done?. With that in mind, I would always encourage functions specific to the data it manipulates.
That being said, if your API allows for any possible type of data to be stored or retrieved (such as 'foo'), than your approach is valid!
Just think, how can I communicate best what options are available?
WARNING; shameless plug:
Your code is remarkably similar to our free tool meshydb. I would encourage you to check it out. It actually aligns well with your project.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great question, when building an API you should always consider your audience. An API is meant to communicate what can be done?. With that in mind, I would always encourage functions specific to the data it manipulates.
That being said, if your API allows for any possible type of data to be stored or retrieved (such as 'foo'), than your approach is valid!
Just think, how can I communicate best what options are available?
WARNING; shameless plug:
Your code is remarkably similar to our free tool meshydb. I would encourage you to check it out. It actually aligns well with your project.