Fix json marshal, add database to space