Update request wrapper to handle errors returned from Sharepoint. Also add in safe JSON parse.