refactored handlers to modularize ajax requests, markup creation, and slideshow handlers