diff --git a/app/hkp/tests.py b/app/hkp/tests.py
index 51852c9ba20e68c25a61a982dff21fdedcad6cb7..d52164885d6599ffc5b5a283777cad32c9286b76 100644
--- a/app/hkp/tests.py
+++ b/app/hkp/tests.py
@@ -46,3 +46,16 @@ class CaseSensitivityTestCase(TestCase):
         """Check that the mixed case can be used to lookup a key"""
         response = self.client.get('/pks/lookup?op=get&search=abCD')
         self.assertEqual(response.status_code, 200)
+
+class NotImplemented(TestCase):
+    """Check that 501 is returned if the operation is not supported"""
+
+    def test_no_args(self):
+        """Check that 501 is returned for no arguemnts"""
+        response = self.client.get('/pks/lookup')
+        self.assertEqual(response.status_code, 501)
+
+    def test_not_get(self):
+        """Check that 501 is returned if op is not get"""
+        response = self.client.get('/pks/lookup?op=search')
+        self.assertEqual(response.status_code, 501)
diff --git a/app/hkp/views.py b/app/hkp/views.py
index fa6b84acd8d8a14ae64e8d380d0996de8130641f..5436322697c129eff0f8f998f8989dc2da7528c9 100644
--- a/app/hkp/views.py
+++ b/app/hkp/views.py
@@ -9,8 +9,8 @@ class HttpNotImplementedError(HttpResponse):
 
 @require_safe
 def lookup(request):
-    op = request.GET.get('op', None)
-    search = request.GET.get('search', None).lower()
+    op = request.GET.get('op', "").lower()
+    search = request.GET.get('search', "").lower()
     
     if op not in ["get"]:
         return HttpNotImplementedError("Not implemented")