'Returns a 401 response code if you are not authorized to perform a specific request.'

@staticmethod
def return_401(request, message=UNAUTHORIZED_RESPONSE_MSG):

    request.setResponseCode(http.UNAUTHORIZED)
    return json.dumps({'error': message})
