beginning migration to Flask.RESTful
big refactoring, ported to Flask-RESTful.