Added database functionality too.It is not coplete as all the test cases have not been written