prevent failure when module does not have a data field

This raised an AttributeError when I tried to retrieve a vertical or a course using the REST API.

Reviewers: @dmitchell, @singingwolfboy