working json api w/mongo