Use os.path.isdir instead of os.path.exists.
Bugfix when printing json response with non ascii chars.
Merge pull request #8 from ddebin/master

Various bugfixes. Thanks @ddebin