Fixed some syntax errors and added exception handling for when there is a problem fetching buffer JSON