Change in db Singleton and modified the REST class functionality