Bug fixes and minor tweaks to endpoints