What are possible ways of handling multiple users accessing the same database via custom web API?
Don't connect as root/super user

Read this: Multi-Tenant Data Architecture  

Since it's a web app, you're going to want to use connection pooling, for performance

This means you need to use impersonation, i.e., login as one user then switch to a different user. Because connection pooling requires that everyone in the pool connect with the same connection string.

For Maria/MySQL, read up on https://mariadb.com/kb/en/mariadb/grant/#proxy-privileges 

MySQL/Maria doesn't yet do row security as far as I know, so you'd need to do your access control (via SQL) in the application layer (your web app)

In terms of multiple people editing the same rows at the same time, read up on Optimistic Concurrency Control

Personally, I'd consider Postgres, as it does row security