Made fixes to ensure android 5.0 compatibility, added support for APIs 17+