Add servlet and optimize build process