Add `flatten` option to `/api/info`

If False it will return a single dictionary, otherwise it will follow the old behaviour.
It's True by default to keep backwards compatibility, it will change in a future version.