completed the backend for sending a topic to the database