Adding server script and fixing logging