Hotfix restful api bugs

Fixed various bugs created up when merging the restful-api branch