What do you think about moving this to `App` or `Utils`?  This method isn't just related to the API, it could be useful  in other places.