Updated rest controller to return BadRequest rather than 500

Also needed to fix bugs introduced by several recent master merges.
First, added priority to several INSERTs. Second, had to change
the way config was set in controllers_test.go