Introduce validate method in xblock API.