Implemented some database methods