adding random api, changing db connection to class