optimized wiki.py and implemented a JSON API