Properly surface rule errors to API

Previously, any syntax errors generated when adding a new rule
to a policy would result in the user seeing an Internal Server Error.

This change catches syntax errors and rethrows them using the Exception
class caught by the API and returned to the user.

Change-Id: I4cbe4fef402ff80556f499b0ec7d676623b19d52
Closes-bug: 1356619