explicit debug mode for REST server

Still some issues with logging.