Some cleanup of html, expanded error handling in server