handle json encoded posts and puts
encode post params as json
correct encoding of slices