All html should be formed on the client side, the backend should just return JSON (and for the images of course binary data)