fixed db errors

Added the ability to call to the queries and then also fixed some typos