added constructors and some code to servlet