Refactor magnet info database submission from router to utils