Without fullstack knowledge, in this case, if you don't care how the frontend will fetch data, how can you optimize the backend (just curious).
Fullstack knowledge is nessessary for optimized backend code, seriously.
Ruby has elegant syntax and structure for functional programming as well as OOP, not like broken Python (1-line lambda and broken OOP).