You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: courses_controller.rb
    path of file: ./repos/Autolab/app/controllers/api/v1
    
    the code of the file until where you have to start completion: require 'date'

class Api::V1::CoursesController < Api::V1::BaseApiController

  before_action -> {require_privilege :user_courses}, only: [:index]
  before_action -> {require_privilege :admin_all}, only: [:create]

  skip_befor
    
  def create
    require_params([:name, :semester, :instructor_email])
    
    begin
      # name validation done during create
      newCourse = Course.quick_create(params[:name], params[:semester], params[:instructor_email])
    rescue => e
      raise ApiError.new(e.message, :internal_server_error)
    end

    # set additional params
    if params.has_key?(:start_date)
      newCourse.start_date = safe_parse_date(params[:start_date])
    end