var api = new mw.Api();
api.get({
	action: "query",
	prop: "pageassessments",
	titles: mw.config.get("wgPageName")
}).done(function (data) {
	var assessments = data.query.pages.pageassessments;
	$.each(assessments, function (k, v) {
		//TODO: Rework to avoid hardcoded quality scale
		var classes = [
				"fa", "fl", "a", "ga", "bplus", "b", "c", "start", "stub",
				"al", "bl", "cl", "list", "sl", "dab", "sia", "cur", "future"
			], normed;
		if (assessments.hasOwnProperty(k)) {
			normed = typeof v == "string" &&
				v.trim().toLowerCase();
			if (classes.indexOf(normed) !== -1) {
				ap.foundAssessment = normed;
				return false;
			}
		}
	});
});