This is due to that in JSON (where the code is sent) all tags have been escaped with backlashes “\”. You need to strip these backlashes from your code between the response and you printing it onto site.
This is totally depending on the language you code in - but in PHP (which I use) the correct way to do it would be
$response = some_response_from_a_call.
$html = stripslashes ($response);
If you do not code in PHP - please look up similar to stripslashes in your coding language.
Json needs to be sent with backslash in order not to understand the content as content and not as code. Its a way of transporing your code in a safe way from one place - to the other.