Fixed some oversights in admin and models, added preliminary API.