Flask-Restful basic setup
<p>When I try to go to <code>/api</code> I get to convert my database to an api.</p>

<pre><code>from flask import Flask , render_template   
from flask_restful import Resource, Api,marshal_with, fields
from flask_sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config.from_object('config')
api = Api(app)
db = SQLAlchemy(app)

class songbook(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    song_book = db.Column(db.String(80))
    title = db.Column(db.String(120))
    artist = db.Column(db.String(120))
    disc_number = db.Column(db.String(120))
    track_number = db.Column(db.String(120))

    def __init__(self, song_book, title, artist, disc_number, track_number):
        self.song_book = song_book  
        self.title = title
        self.artist = artist
        self.disc_number = disc_number
        self.track_number = track_number

resource_fields = {
    'song_book': fields.String,
    'title': fields.String,
    'artist': fields.String,
    'disc_number': fields.String,
    'track_number': fields.String,
}

class HelloWorld(Resource):
    @marshal_with(songbook)
    def get(self):
        return songbook.query.all()

api.add_resource(HelloWorld, '/api')

@app.route('/')
def hello_world():
    return render_template("index.html")

if __name__ == '__main__':
    app.run(debug=True)
</code></pre>

<p>I get an error code </p>

<blockquote>
  <p>AttributeError: type object 'songbook' has no attribute 'items'</p>
</blockquote>

<p>I was trying to learn from <a href="http://flask-restful-cn.readthedocs.io/en/0.3.4/fields.html" rel="nofollow">here</a>.  Any other docs or links would be helpful.</p>