huge refactor using flask-restful