Objects as parameters for database related methods

This PR changes database-related methods to use `Article` and `Challenge` objects as parameters.