Adding proper callback handling for server error