Added location tracking logic to backend
Merged in changes. Code beautyfication..
Corrected errors in previous commits.