reformat
Better error handling on server error