Handling api::applications in permissions#put, refactor permissions#put

Squashed commit of the following:

commit efb7a630dd5d3957987be29fafd4da82c05b78b6
Author: Thomas Schank <DrTom@schank.ch>
Date:   Mon Mar 24 22:10:13 2014 +0100

    ...

commit 37b62e6b20ebca9e176f3781c1369183d488ebe3
Author: Thomas Schank <DrTom@schank.ch>
Date:   Mon Mar 24 21:57:12 2014 +0100

    ...

commit e96f3cb85c4c9fc408f9589ea13b9247751a95d9
Author: Thomas Schank <DrTom@schank.ch>
Date:   Mon Mar 24 21:55:50 2014 +0100

    Handling api::applications in permissions#put, some refactorings