Fixing some issues with api