Tidy up chart servlet. Add exceptions. Prepare code for initial review.