Fixed typo in error message.
Updated addDocToIndex to skip parsing JSON if the batch param passed in is already an object.