einsteinx2/WaveBox — pull request #99 by mdlayher (2013-06-25 19:54:48+00:00)
Title: Add limit and range functionality Song model, API handler

This one's a doozy, but it basically allows the following:

Return one song:
http://localhost:6500/api/songs?id=1

Return all songs:
http://localhost:6500/api/songs

Return all songs in range C-F
http://localhost:6500/api/songs?range=C,F

Return 10 songs
http://localhost:6500/api/songs?limit=10

Return 10 songs, starting at index 10
http://localhost:6500/api/songs?limit=10,10

Return 3 songs in range C-F
http://localhost:6500/api/songs?range=C,F&limit=3

Return 3 songs in range C-F, starting at index 10
http://localhost:6500/api/songs?range=C,F&limit=10,3

Phew. Let me know how you guys feel about this one. I tried to be as faithful as possible to the SQL results, while trying to not pull more results than I need.