Add util methods (strToJson and guess contentType)