Fixed API to work with new submit model.

Fixed a lot of issues with the api.
Made json serialization standardized.
Fixed a bunch of pylint messages.
Other random things.