Added error message for failed json returns