preliminary http/rpc handlers refactoring