Improve console rest api memory usage by reducing copies