added a bunch to api

created helper functions to deal with pathnames, defined global
variables, created login, create user, and fopen, unable to test
functions without other functions available