added login with Flask-Login, changed endpoints to be more RESTy and wrote tests to validate it