Tweaks and bug fixes to a few API endpoints