some fixes on backend, added serialize/deserialze