This is the Javascript and JSON I wrote for my fitness app at Angel Hack SF 2012, the code here has functions to persist data to the firebase database and retrieve it as well