API endpoints:
Players
- GET url/api/players/username/:userid, fetches the user entity with the given id.
- GET url/api/players/login/:username/:password, fetches the user entity if username and password matches.
- PUT url/api/players/ creates a new user with (String) username and (String) password, if username is not taken.
Games
- GET url/api/games/, fetches all games in the database.
- GET url/api/games/gamename/:gameid, fetches the game with given id.
- POST url/api/games/, creates a new game with (String) name. Don't use this method.
Highscores
- GET url/api/highscores/gamescore/:userid/:gameid, fetches the users highscore for that game.
- POST url/api/highscores/highscore/, post a new highscore for that user for that game with the given value. Creates a new one if one doesn't exist, updates already exist one. Takes in gameid(String), userid(String) and value(int).
- GET url/api/highscores/userscore/:userid, fetches all highscores for a user (all games).
- GET url/api/highscores/gamescores/:gameid, fetches the top 5 highscores for game (all users).