Tweaked indentation and cleaned up formatting
Removed some extraneous brackets
Added more permissions to indexing ajax, now also only works if logged in
Merge branch 'develop'