creates model and endpoint for categories