added JSON framework; if offline, search DB