Adds NullpointerException handling to Servlet

Change-Id: I0486708d160abe8a4ea4e0fcec38882e5492b3cb