Backend Fixes and Improvments

several fixes to bugs and improved back-end functionality