added madlib routes and fixed a bug