Added support for iOS devices
Cleaned up backend code