Implement prolog server