api encoding problem