When polling check if data is defined

Prevent a javascript error that could stop polling. This happens
when a request returns a 204 No Content. jQuery success callback
has no data in this case causing an error.