Check app key on getInstance

@aaustin 
This change was committed to my other branch, but never got merged to master.