A few API bugfixes and more implemented tests

Also changes api.rb's #notification_rules to return all the rule data instead of just IDs, as requested by @skorfmann.

I've tested the resulting code with a flapjack-diner gem built from https://github.com/ali-graham/flapjack-diner/tree/55_notification_rules and it's all OK on that score.