Updated Code

Fixed errors and created new API files.