Added Oauth 2.0

The API was completely exposed, so an Oauth 2.0 is implemented for
authentication. However, this is a very coarse implementation:
 * The access token is not yet assigned to an user.
 * Real scopes MUST be implemented
Read PUT contents before API check

for some weird reason, the php://input cease to exist after executing
OAuth functions