remove empty json elements, request body encoding