clean up modules, send json on delete requests