builds html markup from json