This is a decent article on the description of HTTP methods but might be misleading to a beginner. You are not designing an API as the title says. You are using one.

You also do not explain what RESTful means.

API is application programming interface. That is what your code does. It is an application interfacing with a back end API.

Confusing to most beginners is PATCH versus POST. This deserves more attention.

Implementing PATCH when designing an API can be confusing as one has to determine which piece of data in the resource changed and update just that one piece of data.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store