A major RESTful API rewrite

Rewritten API to handle creating pins for both urls
and previously-uploaded images. Added some tests for it.