proxy: return JSON errors
proxy: add a todo for logging
Merge pull request #1685 from xiang90/proxy

proxy: return JSON errors