Rest api

More API work. Biggest changes: fully-qualified URLs and scan thumbnails