fixed bugs with db refactor and facebook token exchange