added basic tests; fixed issue with returning JSON