rewrote the encoding methods, added analytics helper, utilized martinis middleware