clone attached API and always set api.db to instance, fixes #18