while coding a simple to-do list app enhanced with (true) end-to-end encryption as a coding exercise, I was wondering if the server-side API code changes from a plain text storage (excepts passwords) to an end-to-end encrypted app.

Indeed, if the data is truly E2EE, everything should be happening on the client side and the server just takes care of storing and retrieving the encrypted data.
The server should not treat incoming data differently if it is encrypted or not, should it?

That means that the same server and the same server-side program could be used by an E2EE client or a normal (plain text) client.
Indeed, the client could be sending encrypted data or not, the server would just store it and send it back when the user asks for it.
It is then up to the user to decrypt the data if they had encrypted it.

That makes me asks how can a server-side application enforce his user to use E2EE?  

Can a server know if incoming data has been properly encrypted?