Calling the json to return error/success message