created rest apis and db helper functions