def create_response(json, code=200):
    """
    Create a json response with a custom HTTP code.
    :param json: result of jsonify
    :param code: responsecode, 200 is the default one
    :return: Response to the callee
    """
    response = json
    response.status_code = code
    response.mimetype = "text/json"
    return response