Added a getUserId function and insertion query functions.