try encoding api request