added error pages. refactored Listener. more or less done for now