# Protecting glossaries key against \MakeTextLowercase

I'm using glossaries together with titlesec, which adds \MakeTextLowercase to the \section command. This breaks glossaries, since the key is now lower case.

MWE:

\documentclass{article}
\usepackage{glossaries}
\newacronym{API}{API}{Application Programming Interface}
\begin{document}
\section{\MakeTextLowercase{\Acrlong*{API}}}
\end{document}


Fails with

Package glossaries Error: Glossary entry api' has not been defined. \section{\MakeTextLowercase{\Acrlong*{API}}}
`

Is there a way to protect the key against this, other than changing it to lower case?