Fix slicing remaining path
Only encode response if it's not bytes already