Keeping track of byte length and sending back to the API