add logger, improve rest