Added apis to match iOS SDK, miscellaneous bug fixes