made http work with promises, cleaned rpc more