Added test cases, fixed failure cases, can now differentiate between json null and db null