server: refactoring & added logger output to browser