Added hub functionality and changed the database calls.