Added database query stuff to test app