Fix RESTful API and sessions
Add python client API