fixed json serialization
made it possible to query using an index