Created db Singleton and modified the REST class functionality