Created test for servlet and optimized code