Working on new API for object encoder