update api module for image fixes

This allows setting a URL for an image for persons and organizations
over the API. It also correctly displays the _id field of images added
using the front end and provides the URL for images hosted on the popit
instance.