More api.py refactoring. No results now returned instead of error message. Also, event searching is mostly implemented (except for time searching)