server/api: little refactoring
server/api: send a lame email after finish