refactoring rpc to be in line with new wsgi application handlers