[services/admin] add code ported from tornado