Fixed null pointer exceptions which happened when the REST request failed.
Added admin privilege filtering.