Moved StudyGuides handler to api.php &improvements

and improved type of attachment recognition
Update api.php
Merge pull request #13 from MegaCookie/patch-4

Moved StudyGuides handler to api.php &improvements