CLIMATE-382 - Fix UI backend content type issues

- Stop parsing JSON with ast.literal_eval in tests. Replace with the more
  correct json.loads.
- json.dumps is no longer called on all output JSON. When returning
  plain JSON this was causing the content type to be incorrectly set as
  text. Now json.dumps is only called when returning a JSONP response so
  we have the dictionary properly serialized. Bottle handles
  automatically setting the content type when returning a dictionary, so
  we don't need to manually set the content-type.