Corrected encoding, better parser, add API function (not implemented)