'Send a response back to the client with the HTTP `status_code` (int),
the given content serialized as JSON (str), and the headers set appropriately.'

def respond(self, status_code=200, content=None):

    headers = {'Access-Control-Allow-Origin': '*'}
    if ((status_code < 400) and content):
        headers['Content-Type'] = 'application/json'
        content = json.dumps(content)
    else:
        headers['Content-Type'] = 'text/html'
    self.send_response(status_code, content, headers)
