[#285] Move function into only function using it
[#285] Move function into API controller as only user