Added models and fields. also added some minor validation and permissions