Working Rest API with mock Security framework