Completed Firebase implementation.