proper use of codec
use json as default codec (others dont seem to work)