Supporting custom deserializers, fixing API and adding more unit tests