Py server race condition fix, double json parse fix

Couple of fixes to the python server:
1. There's a potential race condition involving the context object when running in asynchronous mode. Made the context object a method parameter to resolve this.
2. The json request body was being parsed and stored in memory twice; fixed.